package com.boliq.lol.ui.news;

import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.boliq.demo.R;
import com.boliq.lol.adapter.NewsArticleAdapter;
import com.boliq.lol.base.BaseFragment;
import com.boliq.lol.bean.NewsArticleBean;

import java.util.ArrayList;
import java.util.List;

public class RecommendFragment extends BaseFragment {
    private RecyclerView mRecyclerView;
    private NewsArticleAdapter mAdapter;


    @Override
    protected int rootLayout() {
        return R.layout.fragment_recommend;
    }

    @Override
    protected void initView(View view) {
        mRecyclerView = view.findViewById(R.id.recommend_content_list);
    }

    @Override
    protected void initData() {
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mAdapter=new NewsArticleAdapter();
        mRecyclerView.setAdapter(mAdapter);
    }

    @Override
    protected void bindEvent() {
        super.bindData();
        List<NewsArticleBean> newsBeans = new ArrayList<>();
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_1,"竞猜即赢小蜜蜂宝典小花，2021“LPL小蜜蜂猜猜乐”活动开启","LOL","英雄联盟官方赛事","6.9k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_2,"《LOL》2021小蜜蜂活动","LOL","英雄联盟官方赛事","8k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_3,"英雄联盟“小蜜蜂2021”系列皮肤正式上线","LOL","英雄联盟官方赛事","15k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_4,"《英雄联盟》2021战斗学院皮肤公布 凯特琳悟空等加入","LOL","英雄联盟官方赛事","10.5k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_5,"苏宁旗下SN电竞俱乐部面临出售 处在转售边缘","LOL","英雄联盟官方赛事","8.1k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_6,"《英雄联盟》宇宙MMORPG公开 正在招聘美工和设计师","LOL","英雄联盟官方赛事","14k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_7,"《英雄联盟》8万多个账号被封10年 因发布恶意信息","LOL","英雄联盟官方赛事","11.6k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_8,"峡谷最牛知识达人","LOL","英雄联盟官方赛事","9,7k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_9,"电竞春晚、福牛守护者表演赛圆满落幕","LOL","英雄联盟官方赛事","15.3k"));
        newsBeans.add(new NewsArticleBean(R.drawable.news_f_10,"《英雄联盟》发布公告 紧急修复游戏过程崩溃问题","LOL","英雄联盟官方赛事","7k"));
        mAdapter.addData(newsBeans);
    }
}
